package org.blogwu.smart.s051;

/**
 * 验证行缓存
 *
 * @author xiaohu
 * @date 2021/11/22
 **/
public class CacheTest {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        int[][] a = new int[2048][2048];
        for (int i = 0; i < 2048; i++) {
            for (int j = 0; j < 2048; j++) {
                //  a[i][j] =1; // 按行赋值   9ms ~12ms
                a[j][i] = 1; // 按列赋值  30~32ms  因为用不到缓存行，所以比较慢
            }
        }
        System.out.println("time======" + (System.currentTimeMillis() - start));
    }
}
